//
//  NSDate+ConvertString.m
//  CommonBusiness
//
//  Created by leev on 2017/10/26.
//  Copyright © 2017年 XES. All rights reserved.
//

#import "NSDate+ConvertString.h"

@implementation NSDate (ConvertString)

- (NSString *)getDateString {
    return [self getDateStringWithFormat:@"yyyy-MM-dd HH:mm:ss"];
}

- (NSString *)getDateStringWithFormat:(NSString *)dateFormat {
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:dateFormat];
    NSString *strDate = [dateFormatter stringFromDate:self];
    return strDate;
}

@end
